#ifndef SQLEXEC_H
#define SQLEXEC_H

#include <QObject>
#include <QtSql/QSqlDatabase>
#include <memory>
class QSqlDatabase;
class SqlExec : public QObject {
  Q_OBJECT
public:
  SqlExec(QObject *parent = nullptr);

  void open(const QString &name);

  bool add_device(int devID, const QString &name);

  bool add_dev_data(int devID, const QString &content);

  bool update_dev_data(int devID, const QString &status);

  bool selValue1();
  bool delValue1(int id);

signals:
  void opened();

private slots:
  void openedSlot();

private:
  QScopedPointer<QSqlDatabase> db;
};

#endif // SQLEXEC_H
